package cn.iocoder.yudao.module.cfs.dal.mysql.userappconfig;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.cfs.controller.admin.userappconfig.vo.UserAppConfigPageReqVO;
import cn.iocoder.yudao.module.cfs.dal.dataobject.userappconfig.UserAppConfigDO;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Mapper;

/**
 * 社会运营平台_app配置 Mapper
 *
 * @author 芋道源码
 */
@Mapper
@DS("chengan")
public interface UserAppConfigMapper extends BaseMapperX<UserAppConfigDO> {

    default PageResult<UserAppConfigDO> selectPage(UserAppConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserAppConfigDO>()
                .eqIfPresent(UserAppConfigDO::getAppId, reqVO.getAppId())
                .eqIfPresent(UserAppConfigDO::getAppKey, reqVO.getAppKey())
                .eqIfPresent(UserAppConfigDO::getThirdId, reqVO.getThirdId())
                .eqIfPresent(UserAppConfigDO::getAreaCode, reqVO.getAreaCode())
                .likeIfPresent(UserAppConfigDO::getAreaName, reqVO.getAreaName())
                .eqIfPresent(UserAppConfigDO::getOperatorId, reqVO.getOperatorId())
                .likeIfPresent(UserAppConfigDO::getThirdDataName, reqVO.getThirdDataName())
                .eqIfPresent(UserAppConfigDO::getThirdDataTel, reqVO.getThirdDataTel())
                .eqIfPresent(UserAppConfigDO::getCodePrefix, reqVO.getCodePrefix())
                .eqIfPresent(UserAppConfigDO::getOnLine, reqVO.getOnLine())
                .betweenIfPresent(UserAppConfigDO::getExpireTime, reqVO.getExpireTime())
                .eqIfPresent(UserAppConfigDO::getLimitDeviceCode, reqVO.getLimitDeviceCode())
                .eqIfPresent(UserAppConfigDO::getStatus, reqVO.getStatus())
                .eqIfPresent(UserAppConfigDO::getCreateUser, reqVO.getCreateUser())
                .eqIfPresent(UserAppConfigDO::getUpdateUser, reqVO.getUpdateUser())
                .eqIfPresent(UserAppConfigDO::getThirdControlCenterId, reqVO.getThirdControlCenterId())
                .orderByDesc(UserAppConfigDO::getId));
    }

}